package com.aaa.demo11102;

/**
 * @author 荆豪峰
 * @version 1.0
 */
public class Test111 {
    public static void main(String[] args) throws InterruptedException {
        Yields y1 = new Yields();
        Yields y2 = new Yields();
        y1.start();
        y2.start();
    }
}
class Yields extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 20;i++) {
            Thread.yield();
            System.out.println(Thread.currentThread().getName() + "==="+i);

         }
    }
}